package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;


public class CustomerCtr
{
   
    private CustomerList customerList;
    private Customer customer;


    public CustomerCtr()
    {
        customerList = CustomerList.getInstance();
    }

    public void createCustomer(int customerId, String name, String company, String city, String address, String postalCode,String phoneNumber, String email)
    {
       customer = new Customer(customerId, name, company, city, address, postalCode, phoneNumber, email);
       customerList.addCustomer(customer);
    }
    
    public void addCustomerDiscount(int customerId, int customerDiscount)
    {
        
        customerList.findCustomer(customerId).setCustomerDiscount(customerDiscount);
        
    }
    
    public void removeCustoemrDiscount(int customerId)
    {
    	customerList.findCustomer(customerId).removeCustomerDiscount();
    }
    
    public int getCustomerIdByName(String name)
    {
    	customerList.findCustomerName(name);
    	return customer.getCustomerId();
    }
    
    public void deleteCustomer(int customerId)
    {
        customerList.deleteCustomer(customerId);
    }
    
    public void setCustomerName(String name, int customerId)
    {
        customerList.findCustomer(customerId).setName(name);
    }
    
    public void setCustomerCompany(String company, int customerId)
    {
        customerList.findCustomer(customerId).setCompany(company);
    }
    
    public void setCustomerCity(String city, int customerId)
    {
        customerList.findCustomer(customerId).setCity(city);
    }
    
    public void setCustomerAddress(String address, int customerId)
    {
        customerList.findCustomer(customerId).setAddress(address);
    }
    
    public void setCustomerPostalCode(String postalCode, int customerId)
    {
        customerList.findCustomer(customerId).setPostalCode(postalCode);
    }
    
    public void setCustomerPhoneNumber(String phoneNumber, int customerId)
    {
        customerList.findCustomer(customerId).setPhoneNumber(phoneNumber);
    }
    
    public void setCustomerEmail(String email, int customerId)
    {
        customerList.findCustomer(customerId).setEmail(email);
    }
    
    public int getCustomerId(int customerId)
    {
        return customerList.findCustomer(customerId).getCustomerId();
    }
    
    public String getCustomerName(int customerId)
    {
        return customerList.findCustomer(customerId).getCustomerName();
    }
    
    public String getCustomerCompanyName(int customerId)
    {
        return customerList.findCustomer(customerId).getCompanyName();
    }
    
    public String getCustomerCity(int customerId)
    {
        return customerList.findCustomer(customerId).getCity();
    }
  
    public String getCustomerPostalCode(int customerId)
    {
        return customerList.findCustomer(customerId).getPostalCode();
    }
    
    public String getPhoneNumber(int customerId)
    {
        return customerList.findCustomer(customerId).getPhoneNumber();
    }
    
    public String getCustomerEmail(int customerId)
    {
        return customerList.findCustomer(customerId).getEmail();
    }
    
    public String getCustomerAddress(int customerId)
    {
        return customerList.findCustomer(customerId).getAddress();
    }
    
    
    
    
    
     
}
